package com.gaia.member.androidlib;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.gaia.member.androidlib.Note;
import com.gaia.member.androidlib.BookLib;
import com.gaia.member.androidlib.Student;

import com.gaia.member.androidlib.NoteDao;
import com.gaia.member.androidlib.BookLibDao;
import com.gaia.member.androidlib.StudentDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig noteDaoConfig;
    private final DaoConfig bookLibDaoConfig;
    private final DaoConfig studentDaoConfig;

    private final NoteDao noteDao;
    private final BookLibDao bookLibDao;
    private final StudentDao studentDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        noteDaoConfig = daoConfigMap.get(NoteDao.class).clone();
        noteDaoConfig.initIdentityScope(type);

        bookLibDaoConfig = daoConfigMap.get(BookLibDao.class).clone();
        bookLibDaoConfig.initIdentityScope(type);

        studentDaoConfig = daoConfigMap.get(StudentDao.class).clone();
        studentDaoConfig.initIdentityScope(type);

        noteDao = new NoteDao(noteDaoConfig, this);
        bookLibDao = new BookLibDao(bookLibDaoConfig, this);
        studentDao = new StudentDao(studentDaoConfig, this);

        registerDao(Note.class, noteDao);
        registerDao(BookLib.class, bookLibDao);
        registerDao(Student.class, studentDao);
    }
    
    public void clear() {
        noteDaoConfig.getIdentityScope().clear();
        bookLibDaoConfig.getIdentityScope().clear();
        studentDaoConfig.getIdentityScope().clear();
    }

    public NoteDao getNoteDao() {
        return noteDao;
    }

    public BookLibDao getBookLibDao() {
        return bookLibDao;
    }

    public StudentDao getStudentDao() {
        return studentDao;
    }

}
